#region File Description
//-----------------------------------------------------------------------------
// InputState.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;


namespace DSEngine.Core
{
    public class InputData
    {
        public TouchLocation Location;
        public bool Handled;
    }
    public class InputState
    {
        public const int MaxInputs = 1;

        private TouchCollection TouchState;

        public readonly List<GestureSample> Gestures = new List<GestureSample>();

        public List<TouchLocation> TouchLocation = new List<TouchLocation>();
 
        internal void Update()
        {
            TouchState = TouchPanel.GetState();
            TouchLocation.Clear();
            foreach (var item in TouchState)
            {
                TouchLocation.Add(item);
            }
            Gestures.Clear();
            while (TouchPanel.IsGestureAvailable)
            {
                Gestures.Add(TouchPanel.ReadGesture());
            }
        }

        internal void RemoveTouch(TouchLocation l)
        {
            TouchState.Remove(l);
        } 
    }
}
